﻿@model RotaractProjectCalendar.Models.Project

@{
    ViewBag.Title = "Edycja";
}

<h2>Edycja</h2>

@using(Html.BeginForm("Edit", "Project", FormMethod.Post, new { enctype = "multipart/form-data" }))
{
    @Html.AntiForgeryToken()

    <div class="form-horizontal">
        <h4>Project</h4>
        <hr />
        @Html.ValidationSummary(true)

        @Html.HiddenFor(model => model.Id)
        @Html.HiddenFor(model => model.Modified)
        @Html.HiddenFor(model => model.IpAddress)
        @Html.HiddenFor(model => model.ClubId)

        <div class="form-group">
            @Html.LabelFor(model => model.ProjectTitle, new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model.ProjectTitle)
                @Html.ValidationMessageFor(model => model.ProjectTitle)
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.Description, new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model.Description)
                @Html.ValidationMessageFor(model => model.Description)
            </div>
        </div>

        <img src="@Url.Content(Model.Photo)" class="img-circle img-responsive" alt="Project photo" width="300" />

        <div class="form-group">
            <div class="col-md-offset-2 col-md-10">
                <input type="file" name="Attach" class=" btn btn-default" />
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.StartDateTime, new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model.StartDateTime)
                @Html.ValidationMessageFor(model => model.StartDateTime)
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.EndDateTime, new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model.EndDateTime)
                @Html.ValidationMessageFor(model => model.EndDateTime)
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.Location, new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model.Location)
                @Html.ValidationMessageFor(model => model.Location)
            </div>
        </div>
        
        <div class="form-group">
            @Html.LabelFor(model => model.CityId, "CityId", new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.DropDownList("CityId", String.Empty)
                @Html.ValidationMessageFor(model => model.CityId)
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.CoordinatorId, "CoordinatorId", new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.DropDownList("CoordinatorId", String.Empty)
                @Html.ValidationMessageFor(model => model.CoordinatorId)
            </div>
        </div>

        <div class="form-group">
            <div class="col-md-offset-2 col-md-10">
                <input type="submit" name="Edit" value="Zapisz" class="btn btn-default" />
            </div>
        </div>
    </div>
}

<div>
    @Html.ActionLink("Powrót", "Index")
</div>

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}
